home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol C-14
/
Vol C-14.iso
/
games
/
prototyp.swf
/
scripts
/
frame_8
/
PlaceObject2_22_48
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
< prev
Wrap
Text File
|
2012-04-23
|
778b
|
42 lines
onClipEvent(enterFrame){
_root.speed = speed;
_root.mph = Number(speed) * 2;
_root.mph -= _root.mph % 1;
if(_root.mph < 1)
{
_root.mph = 1;
}
if(Key.isDown(38))
{
speed += 2;
}
if(Key.isDown(40))
{
speed -= 1;
}
if(Math.abs(speed) > 20)
{
speed *= 0.7;
}
if(Key.isDown(37))
{
_rotation = _rotation - 14;
}
if(Key.isDown(39))
{
_rotation = _rotation + 14;
}
speed *= 0.98;
x = Math.sin(_rotation * 0.017453292519943295) * speed;
y = Math.cos(_rotation * 0.017453292519943295) * speed * -1;
if(!_root.boundary.hitTest(_X + x,_Y + y,true))
{
_X = _X + x;
_Y = _Y + y;
}
else
{
speed *= -0.6;
}
}